package routes

import (
	"gin/controllers"

	"github.com/gin-gonic/gin"
)

func SetupRoutes(r *gin.Engine) {

	// 用户相关
	userController := controllers.UserController{}
	r.GET("/", userController.Welcome)
	r.POST("/users/login", userController.UserLogin)
	r.POST("/users/upload-avatar", userController.UploadAvatar)

	// 游戏相关
	gameController := controllers.GameController{}
	r.GET("/games/:gameId", gameController.GetGame)
	r.GET("/games/list/:page", gameController.GameList)
	r.POST("/games", gameController.CreateGame)
	r.POST("/games/:gameId", gameController.StoreGame)
	r.POST("/games/finish/:gameId", gameController.FinishGame)
	r.GET("/games/share/:gameId", gameController.ShareGame)

	// 房间相关
	playController := controllers.PlayController{}
	r.GET("play/list/:page", playController.ListPlay)
	r.POST("play/add/:gameId", playController.CreatePlayer)
	r.POST("play/join/:gameId", playController.JoinGame)

	testController := controllers.TestController{}
	r.POST("test/share", testController.TestShare)
}
